/*
 * @Author: cl
 * @Description:
 * @Date: 2023-04-07 10:23:48
 * @LastEditTime: 2023-04-13 16:38:29
 * @FilePath: \jsnode\nestjs\naota\src\tiger\tiger.module.ts
 * @LastEditors: cl
 */
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'
import { TigerService } from './tiger.service'
import { TigerController } from './tiger.controller'
import { LogerMiddleware } from 'src/loger/loger.middleware'
import { TypeOrmModule } from '@nestjs/typeorm'
import { Tiger } from './entities/tiger.entity'
import { Son } from './entities/son.entity'
import { TigerGuard } from './tiger.guard'

@Module({
  imports: [TypeOrmModule.forFeature([Tiger, Son])],
  controllers: [TigerController],
  providers: [TigerService, TigerGuard],
})
export class TigerModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    //依赖中间件，指定路由
    consumer.apply(LogerMiddleware).forRoutes('tiger')
  }
}
